<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Music-Player: MusicPlayer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Music-Player
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_music_player.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_music_player-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">MusicPlayer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Header for the class <a class="el" href="class_music_player.html" title="Header for the class MusicPlayer.">MusicPlayer</a>.  
 <a href="class_music_player.html#details">More...</a></p>

<p><code>#include &lt;MusicPlayer.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a90d7a7e1566405f63bdcdb13e033208b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_music_player.html#a90d7a7e1566405f63bdcdb13e033208b">AddMedia</a> (<a class="el" href="class_music_media.html">MusicMedia</a> *media)</td></tr>
<tr class="memdesc:a90d7a7e1566405f63bdcdb13e033208b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to add a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> to list of MusicMedia*.  <a href="#a90d7a7e1566405f63bdcdb13e033208b"></a><br/></td></tr>
<tr class="separator:a90d7a7e1566405f63bdcdb13e033208b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2973a09fcb112a7d1a9c14a79c76835"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_t_duration.html">TDuration</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_music_player.html#ad2973a09fcb112a7d1a9c14a79c76835">GetDuration</a> (std::string const &amp;song=&quot;&quot;) const </td></tr>
<tr class="memdesc:ad2973a09fcb112a7d1a9c14a79c76835"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to get the duration of a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> or of all medias from list of MusicMedia*.  <a href="#ad2973a09fcb112a7d1a9c14a79c76835"></a><br/></td></tr>
<tr class="separator:ad2973a09fcb112a7d1a9c14a79c76835"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a704ddcad91046a21bdf160db9586a99c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_music_player.html#a704ddcad91046a21bdf160db9586a99c">Play</a> ()</td></tr>
<tr class="memdesc:a704ddcad91046a21bdf160db9586a99c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to play all medias from list of MusicMedia*.  <a href="#a704ddcad91046a21bdf160db9586a99c"></a><br/></td></tr>
<tr class="separator:a704ddcad91046a21bdf160db9586a99c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fb82b8e723fc613132e69b33b4f75b2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_music_player.html#a4fb82b8e723fc613132e69b33b4f75b2">RemoveMedia</a> (<a class="el" href="class_music_media.html">MusicMedia</a> *media)</td></tr>
<tr class="memdesc:a4fb82b8e723fc613132e69b33b4f75b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to remove a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> from list of MusicMedia*.  <a href="#a4fb82b8e723fc613132e69b33b4f75b2"></a><br/></td></tr>
<tr class="separator:a4fb82b8e723fc613132e69b33b4f75b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d3513a5ed57dd378b3d59562f712d43"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_music_player.html#a3d3513a5ed57dd378b3d59562f712d43">Search</a> (std::string const &amp;search)</td></tr>
<tr class="memdesc:a3d3513a5ed57dd378b3d59562f712d43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to search for a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> from list of MusicMedia*.  <a href="#a3d3513a5ed57dd378b3d59562f712d43"></a><br/></td></tr>
<tr class="separator:a3d3513a5ed57dd378b3d59562f712d43"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header for the class <a class="el" href="class_music_player.html" title="Header for the class MusicPlayer.">MusicPlayer</a>. </p>
<p>Represents a music player which is able to add, remove, play, search or get the duration of songs, albums and music collections.</p>
<p>The class <a class="el" href="class_music_player.html" title="Header for the class MusicPlayer.">MusicPlayer</a> implements several functions which are adding, removing, playing, searching or getting the duration of <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a>. It uses internally a std::list of MusicMedia* which holds all MusicMedias.</p>
<dl class="section author"><dt>Author</dt><dd>Andreas Lehner </dd></dl>
<dl class="section date"><dt>Date</dt><dd>06.12.2012 </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a90d7a7e1566405f63bdcdb13e033208b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MusicPlayer::AddMedia </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_music_media.html">MusicMedia</a> *&#160;</td>
          <td class="paramname"><em>media</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to add a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> to list of MusicMedia*. </p>
<p>The function pushes back a media of type MusicMedia* to the list, if the pointer is valid. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">media</td><td>The music media which will be added. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>Throws an exception on an invalid pointer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad2973a09fcb112a7d1a9c14a79c76835"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_t_duration.html">TDuration</a> MusicPlayer::GetDuration </td>
          <td>(</td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>song</em> = <code>&quot;&quot;</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to get the duration of a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> or of all medias from list of MusicMedia*. </p>
<p>The function searches for all medias which concur with the search string. If at least one media is found, it will be printed to std::cout. All medias will be visited by the <a class="el" href="class_finder.html" title="Header for the class Finder.">Finder</a> Visitor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">song</td><td>The name of the media where the duration is required. If no value is passed, the duration of all medias will be added and returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="struct_t_duration.html" title="A Struct which can store a duration of a song.">TDuration</a> A struct which holds the minutes and secounds of a song or all songs. </dd></dl>

</div>
</div>
<a class="anchor" id="a704ddcad91046a21bdf160db9586a99c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MusicPlayer::Play </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to play all medias from list of MusicMedia*. </p>
<p>The function plays all medias found in the list of MusicMedia* by printing them to std::cout. All medias will be visited by the <a class="el" href="class_player.html" title="Header for the class Player.">Player</a> Visitor and printed out. </p>

</div>
</div>
<a class="anchor" id="a4fb82b8e723fc613132e69b33b4f75b2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MusicPlayer::RemoveMedia </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_music_media.html">MusicMedia</a> *&#160;</td>
          <td class="paramname"><em>media</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to remove a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> from list of MusicMedia*. </p>
<p>The function erases a media of type MusicMedia* of the list, if the pointer is valid and the media is found in the list. Note: Only the pointer will be removed from the list, allocated memory for the media will not be freed! </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">media</td><td>The music media which will be removed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>Throws an exception on an invalid pointer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3d3513a5ed57dd378b3d59562f712d43"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MusicPlayer::Search </td>
          <td>(</td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>search</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to search for a <a class="el" href="class_music_media.html" title="Represents MusicMedia.">MusicMedia</a> from list of MusicMedia*. </p>
<p>The function searches for all medias which concur with the search string. If at least one media is found, it will be printed to std::cout. All medias will be visited by the <a class="el" href="class_finder.html" title="Header for the class Finder.">Finder</a> Visitor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">search</td><td>The name of the media to be searched for. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_music_player.html">MusicPlayer</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
